import Vue from 'vue'
// 导入路由包
import Router from 'vue-router'
// 导入路由组件
import Home from '@/components/tabbar/Home'
import Member from '@/components/tabbar/Member'
import Search from '@/components/tabbar/Search'
import ShopCar from '@/components/tabbar/ShopCar'
import newsList from '@/components/news/newsList'
import newsInfo from '@/components/news/newsInfo'
import photosList from '@/components/photos/photosList'
import photoInfo from '@/components/photos/photoInfo'
import goodsList from '@/components/goods/goodsList'
import goodsInfo from '@/components/goods/goodsInfo'
import goodsdesc from '@/components/goods/goodsdesc'
import goodsComment from '@/components/goods/goodsComment'
// 安装路由
Vue.use(Router)
export default new Router({
  routes: [// 配置路由规则
    {
      path: '/', // 默认页面重定向
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/home/newsList',
      component: newsList
    },
    {
      path: '/home/newsinfo/:id',
      component: newsInfo
    },
    {
      path: '/home/photosList',
      component: photosList
    },
    {
      path: '/home/photoInfo/:id',
      component: photoInfo
    },
    {
      path: '/home/goodsList',
      component: goodsList
    },
    {
      path: '/home/goodsInfo/:id',
      component: goodsInfo,
      name:'goodsinfo'
    },
    {
      path: '/home/goodsdesc/:id',
      component: goodsdesc,
      name:'goodsdesc'
    },
    {
      path: '/home/goodsComment/:id',
      component: goodsComment,
      name:'goodsComment'
    },
    {
      path: '/member',
      component: Member
    },
    {
      path: '/shopcar',
      component: ShopCar
    },
    {
      path: '/search',
      component: Search
    }
  ],
  linkActiveClass: 'mui-active'// 覆盖默认的路由高亮的类，默认的类叫做 router-link-active
})
